<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>会员分销</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :inline="true" :form="form">
            <el-form-item>
                <el-button type="primary" @click="Add">添加</el-button>
            </el-form-item>
            <el-form-item>
                <el-input v-model="form.serachKey" placeholder="请输入内容" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSerach">查询</el-button>
            </el-form-item>
        </el-form>

        <el-table :data="tableData" stripe border height="calc(100vh - 140px)" style="width: 100%" @expand-change="expandChange">
            <el-table-column type="expand" width="60">
                <template slot-scope="props">
                  <el-table :data="props.row.Children.member_share_config_article" style="margin: 5px auto 0; width: 98%;" border>
                    <el-table-column type="index" width="60" label="序号"></el-table-column>
                    <el-table-column prop="Member_Share_Config_Article_SerialNumber" label="明细流水"></el-table-column>
                    <el-table-column prop="Article_Name" label="商品名称"></el-table-column>
                    <el-table-column prop="Divide_Type" label="方案类型">
                        <template v-slot="{row}">
                            {{row.Divide_Type=='0'?'指定分销金额':'根据订单成交额的百分比'}}
                        </template>
                    </el-table-column>
                    <el-table-column prop="Divide_Amount" label="状态">
                        <template v-slot="{row}">
                            <el-tag :type="row.Row_Status=='0'?'success':'danger'">{{row.Row_Status=='0'?'正常':'已作废'}}</el-tab>
                        </template>
                    </el-table-column>
                    <el-table-column prop="Divide_Amount" label="分销金额">
                        <template v-slot="{row}">
                            {{row.Divide_Amount}}{{row.Divide_Type=='1'?'%':''}}
                        </template>
                    </el-table-column>
                    <el-table-column prop="Divided_Days" label="分销天数"></el-table-column>
                    <el-table-column label="操作" width="100">
                      <template v-slot="{row}">
                        <el-button v-if="row.Row_Status=='0'" type="danger" size="small" @click="Delete2(row)">作废</el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </template>
            </el-table-column>
            <el-table-column label="序号" width="50" type="index"></el-table-column>
            <el-table-column prop="Member_Share_Config_SerialNumber" label="流水号"></el-table-column>
            <el-table-column prop="Type_Date" label="是否长期">
                <template v-slot="{row}">
                    {{row.Type_Date=='0'?'短期':'长期'}}
                </template>
            </el-table-column>
            <el-table-column prop="Row_Status" label="状态">
                <template v-slot="{row}">
                    <el-tag :type="row.Row_Status=='0'?'success':'danger'">{{row.Row_Status=='0'?'正常':'已作废'}}</el-tab>
                </template>
            </el-table-column>
            <el-table-column prop="Start_Date" label="开始时间"></el-table-column>
            <el-table-column prop="End_Date" label="结束时间"></el-table-column>
            <el-table-column label="操作">
                <template v-slot="{row}">
                    <el-button v-if="row.Row_Status=='0'" type="danger" size="small" @click="Delete(row.Member_Share_Config_SerialNumber)">作废</el-button>
                  </template>
            </el-table-column>
        </el-table>

        <el-pagination background v-show="total > 0" @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10,20,30,50]"
            :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
    <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../../js/utils.js"></script>
    <script type="text/javascript" src="./js/MemberShareConfig.js"></script>
</body>

</html>